/* syntax.cs
 */

using System; // for console i/o
using Saru.Base.Math;

public class SyntaxSync {
	public static int Main() {
		float myLen = 0.0f;

		// print to stdout (how i flush() this?)
		Console.WriteLine("Starting checks... ");
		
		// begin syntax checks
		////////////////0123456789012
		for (long l=0;l<2000000;l++)
		{
			// 1) create 3x3-float matrix and 3-float vector.
			Saru.Base.Math.Vector3f myVector = new Saru.Base.Math.Vector3f(1.0f,-1.0f,1.0f);
			Saru.Base.Math.Matrix3f myMatrix = new Saru.Base.Math.Matrix3f();
			Saru.Base.Math.Vector3f myOutput = new Saru.Base.Math.Vector3f();

			myVector = myVector + (-myVector * 2.0f)/3.14f;
			myVector.Normalize();
			
			myOutput = myMatrix * myVector;
			
			myLen = myOutput.Length() + myOutput.Dot(myOutput);
		}

		Console.WriteLine("done");
		
		// this is just to shut up the optimizer

		return myLen > 0.0f ? 1 : 0;
	}
}
